#region lockdown
	function Disable-USBDevices 
	{
		<#
			.SYNOPSIS
				This function disables USB Devices.
			.DESCRIPTION
				This function disbales USB Devices based on KB 823732.
			.EXAMPLE
				PS C:\> Disable-USBDevices
			.INPUTS
				None
			.OUTPUTS
				None
			.NOTES
				Settings for this function were grabbed from KB 823732
				http://support.microsoft.com/kb/823732
			.LINK
				www.mwjcomputing.com
			.LINK
				poshsec.codeplex.com
		#>
		
		
		# Store the paths to the files that makes USB work.
		$usbFiles = "$env:SystemRoot\Inf\Usbstor.pnf", "$env:SystemRoot\Inf\Usbstor.inf"
		
		# Loop through each file
		foreach ($file in $usbFiles) {
			# Get Current ACL
			$acl = (Get-Item $file).GetAccessControl("Access")
			# Create Deny Read Access Rule for system users
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","Read","Deny")
			# Add Deny Read Access Rule for system users
			$acl.AddAccessRule($accessRule)
			# Create Deny Read and Execute Access Rule for system users
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","ReadAndExecute","Deny")
			# Add Deny Read and Execute Access Rule for system users
			$acl.AddAccessRule($accessRule)
			# Create Deny Read Access Rule for SYSTEM
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","Read","Deny")
			# Add Deny Read Access Rule for SYSTEM
			$acl.AddAccessRule($accessRule)
			# Create Deny Read and Execute Access Rule for SYSTEM
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","ReadAndExecute","Deny")
			# Add Deny Read and Execute Access Rule for SYSTEM
			$acl.AddAccessRule($accessRule)
			# Apply Access Rule Changes
			Set-Acl -Path $file -AclObject $acl
		}
		
		# Set Registry Path to USBSTOR
		$RegistryPath = "HKLM:\System\CurrentControlSet\Services\USBSTOR"
		# Set Start Property Value to 4
		Set-ItemProperty -Path $RegistryPath -Name "Start" -Value 4
	} #end function Disable-USBDevices

	function Enable-USBDevices 
	{
		<#
			.SYNOPSIS
				This function enables USB Devices.
			.DESCRIPTION
				This function enables USB Devices based on KB 823732 after being disabled by Disable-USBDevices.
			.EXAMPLE 
				PS C:\> Enable-USBDevices
			.INPUTS
				None
			.OUTPUTS
				None
			.NOTES
				Settings for this function were grabbed from KB 823732
				http://support.microsoft.com/kb/823732
			.LINK
				www.mwjcomputing.com
			.LINK
				poshsec.codeplex.com
		#>
	
		
		# Store the paths to the files that makes USB work.
		$usbFiles = "$env:SystemRoot\Inf\Usbstor.pnf", "$env:SystemRoot\Inf\Usbstor.inf"
		
		# Loop through each file
		foreach ($file in $usbFiles) {
			# Get Current ACL
			$acl = (Get-Item $file).GetAccessControl("Access")
			# Create Deny Read Access Rule for system users
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","Read","Deny")
			# Remove Deny Read Access Rule for system users
			$acl.RemoveAccessRule($accessRule)
			# Create Deny Read and Execute Access Rule for system users
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","ReadAndExecute","Deny")
			# Remove Deny Read and Execute Access Rule for system users
			$acl.RemoveAccessRule($accessRule)
			# Create Deny Read Access Rule for SYSTEM
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","Read","Deny")
			# Remove Deny Read Access Rule for SYSTEM
			$acl.RemoveAccessRule($accessRule)
			# Create Deny Read and Execute Access Rule for SYSTEM
			$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","ReadAndExecute","Deny")
			# Remove Deny Read and Execute Access Rule for SYSTEM
			$acl.RemoveAccessRule($accessRule)
			# Apply Access Rule Changes
			Set-Acl -Path $file -AclObject $acl
		}
		
		# Set Registry Path to USBSTOR
		$RegistryPath = "HKLM:\System\CurrentControlSet\Services\USBSTOR"
		# Set Start Property Value to 3
		Set-ItemProperty -Path $RegistryPath -Name "Start" -Value 3
	} #end function Enable-USBDevices
#endregion lockdown

#region ModuleExports
	#region lockdownExports
		Export-ModuleMember -Function "Enable-USBDevices"
		Export-ModuleMember -Function "Disable-USBDevices"
	#endregion lockdownExports
#endregion ModuleExports